//
//  NSArray+Log.m
//  中文输出-字典-类-数组
//
//  Created by 李忠 on 6/17/16.
//  Copyright © 2016 李忠. All rights reserved.
//

#import "Foundation+SDLog.h"

@implementation NSArray (SDLog)

- (NSString *)descriptionWithLocale:(id)locale{
    
    NSMutableString *string = [NSMutableString stringWithString:@"(\n"];
    
    [self enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [string appendFormat:@"\t%@\n",obj];
    }];
    [string appendString:@")\n"];
    
    return string.copy;
}
@end

@implementation NSDictionary (SDLog)

- (NSString *)descriptionWithLocale:(id)locale{
    
    NSMutableString *string = [NSMutableString stringWithString:@"{\n"];
    
    [self enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
        [string appendFormat:@"\t%@ = %@\n", key, obj];
    }];
    
    [string appendString:@"}\n"];
    return string;
}

@end
